
var leftStore = Ext.create('Ext.data.TreeStore', {
    /*autoLoad: true,
    proxy: {
        type: 'ajax',
        url : '../menu/lefttreestore'
    }*/
    data: [
        { text: '非居民用户管理', id: 'lisa@simpsons.com', phone: '555-111-1224',leaf:true,menuUrl:'xx/ss' },
        { text: '作业管理', id: 'bart@simpsons.com', phone: '555-222-1234',leaf:true,menuUrl:'xx/ss' }
    ]
});

window.mainLeft = Ext.create('Ext.list.Tree',{
    listeners:{
        selectionchange:function(obj , record , eOpts) {
            if (record.data.leaf) {
                var jsPath  = record.data.menuUrl
                var pathPara = ""

                if (jsPath.indexOf('?')!=-1) {
                    pathPara =  "/"+jsPath.substring(jsPath.indexOf('?')+1)
                    jsPath = jsPath.substring(0,jsPath.indexOf('?'))
                } 
                
                var jsPath = jsPath.replace("/","%")
                
                
                window.location="index.html#"+jsPath+pathPara
            }
        }
    },
    ui: 'nav', //navigation nav
    //width: 1250,
    height:'100%',
    store:  leftStore
});

/*
{
        root: {
        expanded: true,
            children: [{
                text: 'detention',
                leaf: true,
                iconCls: 'x-fa fa-frown-o'
            }, {
                text: 'homework',
                expanded: true,
                iconCls: 'x-fa fa-folder',
                children: [{
                    text: 'book report',
                    leaf: true,
                    iconCls: 'x-fa fa-book'
                }, {
                    text: 'algebra',
                    leaf: true,
                    iconCls: 'x-fa fa-graduation-cap'
                }]
            }, {
                text: 'buy lottery tickets',
                leaf: true,
                iconCls: 'x-fa fa-usd'
            }]
        }
    }*/